<template>
	<view class="my">
		<view class="my_bg">
			<view class="userimg" @tap="getBatData">
				<view class="img">
					<image :src="caddie_info.head_img"></image>
				</view>
				<view class="username">
					<view>{{caddie_info.user_nickname}}</view>
					<view>{{caddie_info.ball_title}}</view>
				</view>
				<view class="data">
					<text>球童资料</text>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
		</view>
		<!-- 列表导航 -->
		<view class=" bg-white radius-16">
			<view class="balance">
				<view class="balance_le" @tap="getMyBalance">
					<text>我的余额</text>
					<text>￥</text>
					<text>{{caddie_info.user_money}}</text>
				</view>
				<view class="balance_ri" @tap="withdrawal">
					<view>提现</view>
				</view>
			</view>
			<view class="cu-list menu">

				<view class="cu-item arrow list" @tap="getMyPrice" data-url="">
					<view class="content flex align-center list_x">
						<image class="block-32" src="https://www.goldenbeartalent.com/static/images/45222.png"></image>
						<text class="text-df text-black">我的定价</text>
					</view>
				</view>
				<view class="cu-item arrow list" @tap="myAppoinment" data-url="/pages/news/article/article-favoriters">
					<view class="content flex align-center list_x">
						<image class="block-32" src="https://www.goldenbeartalent.com/static/images/45224.png"></image>
						<text class="text-df text-black">预约时间</text>
					</view>
				</view>
				<view class="cu-item arrow list" @tap="getEvaluate" data-url="">
					<view class="content flex align-center list_x">
						<image class="block-32" src="https://www.goldenbeartalent.com/static/images/45225.png"></image>
						<text class="text-df text-black">我的评价</text>
					</view>
				</view>
				<!-- <view class="cu-item arrow list" @tap="handleJump" data-url="">
			    <view class="content flex align-center" >
			      <image class="block-32" src="/static/talent/my/my-4.png"></image>
			      <text class="text-df text-black">成为球童</text>
			    </view>
			</view> -->
				<view class="cu-item arrow list" @tap="shareOrder" data-url="">
					<view class="content flex align-center list_x">
						<image class="block-32" src="https://www.goldenbeartalent.com/static/images/45226.png"></image>
						<text class="text-df text-black">分享下单</text>
					</view>
				</view>

				<view class="cu-item arrow list" @tap="myQrcode" data-url="/pages/index/setting/about">
					<view class="content flex align-center list_x">
						<image class="block-32" src="https://www.goldenbeartalent.com/static/images/45228.png"></image>
						<text class="text-df text-black">我的二维码</text>
					</view>
				</view>
				<view class="cu-item arrow list" @tap="getShareRecord" data-url="/pages/index/setting/feedback">
					<view class="content flex align-center list_x">
						<image class="block-32" src="https://www.goldenbeartalent.com/static/images/45229.png"></image>
						<text class="text-df text-black">分享记录</text>
					</view>
				</view>
				<view class="cu-item arrow list" @tap="getBlack" data-url="">
					<view class="content flex align-center list_x list_x_x">
						<image class="block-32" src="https://www.goldenbeartalent.com/static/images/45230.png"></image>
						<text class="text-df text-black">黑名单</text>
					</view>
				</view>
				<!-- <view class="cu-item arrow list" @tap="handleJump" data-url="/pages/index/setting/setting">
              <view class="content flex align-center">
                <image class="block-32" src="/static/user/icon9.png"></image>
                <text class="text-df text-black">设置</text>
              </view>
          </view> -->
			</view>
		</view>
		<fu-notwork></fu-notwork>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				userInfo: {}, // 当前登录用户的用户信息
				img: global.SYSTEM_CONFIG.logo,
				caddie_info: '',
				is_payPaw: ''
			};
		},
		onShow() {
			uni.showLoading({
				title: '加载中'
			})
			this.getBatInfo()
			this.payPassword()
		},
		methods: {
			getBatInfo() {
				this.$api.post(global.apiUrls.batWork, {
					
				}).then(res => {
					console.log(res)
					uni.hideLoading()
					if(res.data.code ==1) {
						this.caddie_info = res.data.data.caddie_info
						this.caddie_info.user_money = (Math.round(this.caddie_info.user_money*100)/100).toFixed(0)
					} else {
						this.$message.info(res.data.msg)
					}
				})
			},
			getBatData() {
				uni.navigateTo({
					url: '/pages/user/user/batData'
				})
			},
			// 判断是否设置支付密码
			payPassword() {
				this.$api.post(global.apiUrls.postUserCheck_pay_password, {
					
				}).then(res => {
					uni.hideLoading()
					this.is_payPaw = res.data.data.withdraw_paw
				})
			},
			// 提现
			withdrawal() {
				if(this.is_payPaw == '') {
					uni.navigateTo({
						url: '/pages/index/setting/setPayPassword?type=' + 1
					})
				} else {
					uni.navigateTo({
						url: '/pages/user/wallet/withdraw'
					})
					
				}
			},
			// 跳转我的钱包
			getMyBalance() {
				uni.navigateTo({
					url: '/pages/user/user/myBalance'
				})
			},
			// 跳转我的定价
			getMyPrice() {
				uni.navigateTo({
					url: '/pages/user/user/myPrice'
				})
			},
			// 跳转到预约时间
			myAppoinment() {
				uni.navigateTo({
					url: '/pages/user/user/appointmenTime'
				})
			},
			// 跳转我的评价
			getEvaluate() {
				uni.navigateTo({
					url: '/pages/user/user/myEvaluate'
				})
			},
			// 分享下单
			shareOrder() {
				uni.navigateTo({
					url: '/pages/user/user/share'
				})
			},
			// 我的二维码
			myQrcode() {
				uni.navigateTo({
					url: '/pages/user/user/qrcode'
				})
			},
			// 分享记录
			getShareRecord() {
				uni.navigateTo({
					url: '/pages/user/user/shareRecords'
				})
			},
			// 黑名单
			getBlack() {
				uni.navigateTo({
					url: '/pages/user/user/blacklist'
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	page {
		height: 100%;
		background: #f2f2f1 !important;
	}

	.my {
		padding-bottom: 32rpx;
		min-height: 100vh;
		background: #f2f2f1 !important;
	}

	.radius-16 {
		border-radius: 16rpx;
		overflow: hidden;
	}

	.block-50 {
		width: 50rpx;
		min-width: 50rpx;
		height: 50rpx;
		min-height: 50rpx;
	}

	.block-32 {
		width: 44rpx;
		min-width: 44rpx;
		height: 44rpx;
		min-height: 44rpx;
		margin-right: 24rpx !important;
	}

	.block-108 {
		width: 108rpx;
		min-width: 108rpx;
		height: 108rpx;
		min-height: 108rpx;
	}


	/* 状态栏高度 */
	.nav_barH {
		display: block;
		width: 100%;
		height: var(--status-bar-height);
	}

	.userInfo {
		margin-bottom: 20rpx;
		padding: 20rpx 30rpx 0;
	}

	.dir {
		color: #999999;
	}

	.tui-msg-box {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.tui-msg-pic {
		width: 120upx;
		height: 120upx;
		border-radius: 50%;
		border: 1px solid #fff;
		display: block;
		margin-right: 24upx;
	}

	.tui-msg-item {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.tui-msg-name {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		font-size: 34upx;
		line-height: 1;
		color: #fff;
	}

	.tui-msg-content {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		font-size: 26upx;
		line-height: 1;
		color: #9397a4;
	}

	.my {
		position: relative;

		.my_bg {
			width: 100%;
			height: 270rpx;
			background: url(https://www.goldenbeartalent.com/static/images/2.png) no-repeat 100% 100%;
			padding-top: 56rpx;

			.userimg {
				display: flex;
				padding-left: 32rpx;

				.img {
					flex: 2;
					margin-right: 24rpx;
					border-radius: 8rpx;

					// overflow: hidden;
					image {
						width: 108rpx;
						height: 108rpx;
						border-radius: 8rpx;
					}
				}

				.username {
					width: 60%;
					padding-top: 5rpx;

					view:first-child {
						font-size: 32rpx;
						color: #FFFFFF;
						font-weight: bold;
						margin-bottom: 16rpx;
					}

					view:last-child {
						color: #FFFFFF;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 500;
					}
				}

				.data {
					font-size: 24rpx;
					color: #FFFFFF;
					opacity: 0.8;
					margin-right: 32rpx;
					padding-top: 32rpx;
				}
			}
		}

		.bg-white {
			// border-radius: 8rpx !important;
			padding: 0 32rpx;
			// background: red;
			position: absolute;
			top: 200rpx;
			width: 100%;
			background: transparent;
			color: #333333;

			.arrow:before {
				padding-right: 32rpx;
			}
			.balance {
				// padding: 28rpx 32rpx;
				height: 120rpx;
				line-height: 120rpx;
				background: #FFFFFF;
				margin-bottom: 20rpx;
				display: flex;
				padding: 0 32rpx 0 36rpx;
				border-radius: 8rpx;
				.balance_le {
					flex: 8;
					color: #6B6F73;
					font-size: 24rpx;
					text:nth-child(2) {
						color: #EB5D03;
						font-size: 28rpx;
					}
					text:nth-child(3) {
						font-size: 40rpx;
						font-weight: bold;
						color: #EB5D03;
					}
				}
				.balance_ri {
					flex: 2;
					padding-top: 28rpx;
					view {
						width: 160rpx;
						height: 64rpx;
						background: #009B77;
						opacity: 1;
						border-radius: 8rpx;
						text-align: center;
						line-height: 64rpx;
						color: #FFFFFF;
						font-size: 24rpx;
					}
				}
			}
		}
	}

	.my_bgImg {
		position: absolute;
		top: 0;
		left: 0;
		z-index: -1;
		width: 100%;
		height: 431rpx;
	}

	.nav_btns {
		padding: 20rpx 30rpx;

		.item {
			font-size: 48rpx;
			margin-left: 20rpx;
		}

		.cu-avatar {
			background: transparent;
		}

		/* #ifdef MP-WEIXIN */
		padding-right: 240upx;
		/* #endif */
		/* #ifdef MP-ALIPAY */
		padding-right: 170upx;
		/* #endif */
	}

	.userMsg {
		.cu-item {
			background-color: transparent;
		}
	}



	.myOrder {
		image {
			width: 50rpx;
			height: 50rpx;
		}

		.item {
			position: relative;

			.jiaobiao {
				position: absolute;
				top: -20rpx;
				right: 30rpx;
				color: #f02523;
				font-size: 24rpx;
				border: 1rpx solid #f02523;
				border-radius: 100rpx;
				width: 40rpx;
				height: 40rpx;
				line-height: 38rpx;
				text-align: center;
				background-color: #FFFFFF;
				z-index: 9;
			}
		}
	}

	.fonticon {
		font-size: 34rpx;
	}

	.list {
		padding: 0 32rpx !important;
		
	}
	.list_x {
		padding: 32rpx 0;
		border-bottom: 1rpx solid #EEEEEE;
	}
	.list_x_x {
		border-bottom: 1rpx solid #FFFFFF;
	}
	.list:nth-child(1) {
		border-radius: 8rpx 8rpx 0 0;
	}
</style>
